import axios from 'axios';
import {ListProp,CommentProp} from '../../types/list.d';
export const getDetail = (id:number) => {
    return (dispatch:any) => {
        axios.get('/api/detail',{data:{id}}).then(res => {
            dispatch({type:'detail',detail:res.data})
        })
    }
}

export const addLove = (target:ListProp) => {
    return {
        type:'addLove',
        target
    }
}

//添加评论
export const addComment = (comment:CommentProp) => {
    return {
        type:'addComment',
        comment
    }
}